<!--
  @author duanzuocai
  @since 2018/10/19 23:12
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>员工管理</title>
</head>
<body>

<div class="layui-fluid">

    <blockquote class="layui-crumb">组织关系&nbsp;&nbsp;>
        <a lay-href="/mc/staff/list.action">员工管理</a>&nbsp;&nbsp;>&nbsp;
        <zmn th:text="${(staff.staffId == 0) ? '新增员工' : staff.staffName}"></zmn>
    </blockquote>

    <div class="layui-card">

        <div th:replace="mc/staff/_tab::tab"></div>

        <form method="post" action="" class="layui-form" lay-filter="zmn-staff-form">
            <input type="hidden" name="staffId" th:value="${staff.staffId}"/>

            <div class="layui-card-header" style="margin-top:10px;"><b>基本信息</b></div>
            <div class="layui-split">&nbsp;</div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">姓名</label>
                <div class="layui-input-inline" >
                    <input type="text" name="realName" lay-verify="required" th:value="${staff.realName}" autocomplete="off"
                           class="layui-input" maxlength="8"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">账号</label>
                <div class="layui-input-inline" >
                    <input type="text" name="staffName" lay-verify="loginId" th:value="${staff.staffName}" autocomplete="off"
                           class="layui-input" maxlength="18" th:if="${staff.staffId == 0}"/>
                    <input type="text" th:value="${staff.staffName}" autocomplete="off" class="layui-input" readonly
                           th:if="${staff.staffId > 0}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">入职时间</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <input type="text" name="entryTime" th:value="${staff.entryTime}" class="layui-input" id="entryTime"
                               placeholder="入职时间" lay-verify="required" autocomplete="off">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">试用期</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <select name="probationPeriodType" lay-search="">
                            <option value="">请选择</option>
                            <option th:each="period:${periods}" th:value="${period.key}" th:text="${period.value}"
                                    th:selected="${period.key == staff.probationPeriodType}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">转正时间</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <input type="text" name="becomeFormalTime" th:value="${staff.becomeFormalTime}" class="layui-input" id="becomeFormalTime"
                               placeholder="yyyy-MM-dd" autocomplete="off">
                    </div>
                </div>
            </div>
           
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">公司</label>
                <div class="layui-input-inline" >
                    <select name="companyId" lay-filter="companyId" lay-search="" lay-verify="required">
                        <option value="">请选择</option>
                        <option th:each="company:${companys}" th:value="${company.key}" th:text="${company.value}"
                                th:selected="${company.key == staff.companyId}"></option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">所属部门</label>
                <div class="layui-input-inline" style="width:600px;">
                    <select name="deptId" id="deptId" xm-select-radio xm-select="deptId" lay-verify="required">
                        <option value="">请选择</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">职级</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <select name="positionLevel" lay-search="">
                            <option value="">请选择</option>
                            <option th:each="position:${positions}" th:value="${position.key}" th:text="${position.value}"
                                    th:selected="${position.key == staff.positionLevel}"></option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">手机号</label>
                <div class="layui-input-inline" >
                    <input type="text" name="mobile" th:value="${staff.mobile}" lay-verify="mobile" autocomplete="off"
                           class="layui-input" maxlength="11"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">员工状态</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <select name="staffStatus" lay-search="" lay-verify="required">
                            <option value="">请选择</option>
                            <option th:each="status:${staffStatusList}" th:value="${status.key}" th:text="${status.value}"
                                    th:selected="${status.key == staff.staffStatus}"></option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">员工类型</label>
                <div class="layui-input-inline">
                    <select name="roleType" lay-search="" lay-verify="required">
                        <option value="">请选择</option>
                        <option th:each="role:${roleTypes}" th:value="${role.key}" th:text="${role.value}"
                                th:selected="${role.key == staff.roleType}"></option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">工号</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <input type="text" name="staffNumber" th:value="${staff.staffNumber}" placeholder="工号"
                               lay-verify="required" autocomplete="off" class="layui-input" maxlength="100"/>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">档案号</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <input type="text" name="archivesNumber" th:value="${staff.archivesNumber}" placeholder="档案号"
                               autocomplete="off" class="layui-input" maxlength="100"/>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline" style="width:600px;">
                        <textarea placeholder="50字以内" maxlength="50" th:text="${staff.remark}" id="remark" name="remark"
                                  class="layui-textarea"></textarea>
                    </div>
                </div>
            </div>

<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label">电话</label>-->
<!--                <div class="layui-input-inline" >-->
<!--                    <input type="text" name="phone" th:value="${staff.phone}" autocomplete="off"-->
<!--                           class="layui-input" maxlength="20"/>-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label layui-form-required">邮箱</label>-->
<!--                <div class="layui-input-inline" >-->
<!--                    <input type="text" name="mail" th:value="${staff.mail}" lay-verify="required" autocomplete="off"-->
<!--                           class="layui-input" maxlength="45"/>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label layui-form-required">排序</label>-->
<!--                <div class="layui-input-inline" >-->
<!--                    <input type="text" name="sort" th:value="${staff.sort}" lay-verify="sort" autocomplete="off" class="layui-input" maxlength="6"/>-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label layui-form-required">状态</label>-->
<!--                <div class="layui-input-inline">-->
<!--                    <select name="status" lay-verify="required">-->
<!--                        <option th:each="status:${statuses}" th:value="${status.key}" th:text="${status.value}"-->
<!--                                th:selected="${status.key == staff.status}">-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->

            <div class="layui-form-item">
                <label class="layui-form-label">角色</label>

                <div class="layui-input-block">
                    <input type="checkbox" th:each="role,stat:${roles}" name="roles" th:value="${role.roleId}" lay-skin="primary" th:title="${role.roleName}" th:checked="${role.status == 1}">
                </div>
            </div>
            <zmn th:if="${staff.staffId > 0}">
                <div class="layui-card-header"><b>其他信息</b></div>
                <div class="layui-split">&nbsp;</div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">修改人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux"
                             th:text="${staff.updater} + '&nbsp;/&nbsp;' + ${#dates.format(staff.updateTime, 'yyyy-MM-dd HH:mm:ss')}">修改人/时间</div>
                    </div>
                </div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">创建人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux"
                             th:text="${staff.creater} + '&nbsp;/&nbsp;' + ${#dates.format(staff.createTime, 'yyyy-MM-dd HH:mm:ss')}">创建人/时间</div>
                    </div>
                </div>
            </zmn>

            <div class="layui-split">&nbsp;</div>
            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div class="layui-footer" style="left: 0;">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-staff-form-submit" th:if="${#authPermit.checkPermit('/mc/staff/addEdit.action')}">保存</button>
                        <button class="layui-btn layui-btn-primary" onclick="parent.layui.element.tabDelete('layadmin-layout-tabs', window.location.pathname + window.location.search)">取消</button>
                    </div>
                </div>
            </div>

        </form>

    </div>

</div>

<script type="text/javascript" th:inline="javascript">

    var json = {
        deptIds: [[${deptIds}]],
        staff: [[${staff}]]
    };

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        art_staff_detail: "mc/staff/zmn.art.staff.edit",
    }).use(['index', 'art_staff_detail']);

</script>
</body>
</html>